package com.ft.service.impl;

import com.ft.domain.CommodityType;
import com.ft.dao.CommodityTypeDao;
import com.ft.service.CommodityTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ft
 * @since 2022-06-01
 */
@Service
public class CommodityTypeServiceImpl extends ServiceImpl<CommodityTypeDao, CommodityType> implements CommodityTypeService {
    @Autowired
    CommodityTypeDao commodityDao;

    /**
     * 查询所有商品类型信息
     * @return 商品类型集合
     */
    @Override
    public List<CommodityType> getCommodities() {
        List<CommodityType> commodities = commodityDao.getCommodities();
        return commodities;
    }
    /**
     * 修改商品类型信息
     * @param commodityType 传入的商品类型对象
     * @return 返回受影响的行数
     */
    @Override
    public int updateCommodityType(CommodityType commodityType) {
        int i = commodityDao.updateCommodityType(commodityType);
        return i;
    }
}
